<?php get_header();?>
<!-- Trang nha hang -->
<body>
<div id="wrapper">
	<?php require_once TEMPLATEPATH.'/views/view-header.php';?>
    <?php require_once TEMPLATEPATH.'/views/view-menu.php';?>
    <div id="header-third">
    		<!--slideshow-->
 		   	<?php require_once TEMPLATEPATH.'/views/view-slide-show.php';?>
		    <!--end slideshow--> 
            <!--container-->
         <div id="container">
         <?php require_once TEMPLATEPATH.'/views/view-breadcrumb.php';?>
         <div class="clear"></div>
         <!--main content-->
            <div id="maincontent">
            	<?php 
                        	$args = null;
							$num_post		= 5;
							$post_type		= 'testimonials'; 
							$orderby		= 'date';
							$order			= 'DESC';
							$meta_key		= $wpdb->prefix.'display';
							$meta_value		= 'display';
							//$args = db_query_all_post_in_post_type($num_post, $post_type, $orderby, $order, $meta_key, $meta_value);
							$args = db_query_post_in_posttype_paged($num_post, $post_type, $meta_key, $meta_value, $paged);					
							query_posts($args);
							
                        	?>
            	
            	<div id="page-index" class="page-list-testimonials-11-1"> 
            		<div class="send-testimonials"><a href="<?php echo WP_MYSITE_URL;?>/send-testimonial">aaa</a></div>                
                	
                    <div class="gioithieu">                    
	                    <h3>Testimonials</h3>                                                                      
		                   <ul>
		                   	<?php
							if(have_posts())
							{
								while (have_posts())
								{
									the_post();
									$post_id = get_the_ID();
									$title = get_the_title($post_id);
									$perlink = get_permalink($post_id);
									$thumbnail = db_get_post_meta($post_id, $wpdb->prefix.'thumbnail');
									$excerpt = db_shortDesc(get_the_content(), 200);
									$alt = db_get_alt_attachment_id($post_id, $wpdb->prefix.'thumbnail');
									if(!$alt)
										$alt = db_vietnamese_slug($title);
									?>
									<li>
			                        	<div class="bg-list-tin">
			                        		<a href="<?php echo $perlink;?>">
			                        			<img src="<?php bloginfo('stylesheet_directory'); ?>/timthumb.php?src=<?php echo $thumbnail;?>&w=135&h=100" border="0"" alt="<?php echo $alt;?>">
			                        		</a>	
			                        	</div>
			                            <p>" 
			                            <?php echo $excerpt;?>
			                            "</p>
			                            
			                        </li>
									<?php 
								}
								//wp_reset_query();
								$args = null;
							}
							?>		                   		
		                       
		                   </ul> 
                    <div class="pages">
						<?php 
						bt_paginate();
						?>	
					</div>
	                          	
                    </div>
                    
                </div>
                
                
            </div>
            <!--main content-->
            <!--sidebar-right-->
            <?php get_sidebar();?> 
            <!--sidebar-right-->
            <div class="clear"></div> 
        </div>
        <!--container-->
        <!--bgfooter-->
<?php get_footer();?>
          